<template>
  <div class="management-left">
    <!-- 上 -->
    <div class="management-left-top">
      <h4>
        <span></span>
        <span>管理维护告警统计</span></h4>
      <!-- 切换选项卡 -->
      <el-tabs type="card"
               v-model="activeName">
        <!-- 近30天 -->
        <el-tab-pane label="近30天"
                     name="first">
          <div class="dayContent"
               v-for="item in nearThree"
               :key="item.id">
            <img :src="item.url"
                 class="image" />
            <div>
              <h5 :style="{color:item.color1}">{{item.span}}</h5>
              <h1 :style="{color:item.color2}">{{item.p}}</h1>
              <span :style="{color:item.color1}">{{item.unit}}</span>
            </div>
          </div>
        </el-tab-pane>
        <!-- 近半年 -->
        <el-tab-pane label="近半年"
                     name="second">
          <div class="dayContent"
               v-for="item in nearSix"
               :key="item.id">
            <img :src="item.url"
                 class="image" />
            <div>
              <h5 :style="{color:item.color1}">{{item.span}}</h5>
              <h1 :style="{color:item.color2}">{{item.p}}</h1>
              <span :style="{color:item.color1}">{{item.unit}}</span>
            </div>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>
    <!-- 中 -->
    <div class="management-left-center">
      <h4>
        <span></span>
        <span>环境监测告警趋势</span></h4>
      <EchartsEnvironment></EchartsEnvironment>
    </div>
    <!-- 下 -->
    <div class="management-left-bottom">
      <h4>
        <span></span>
        <span>人车流量监测告警趋势</span></h4>
      <EchartsPeopleCarFlow></EchartsPeopleCarFlow>
    </div>
  </div>
</template>
<script>
import EchartsEnvironment from "@/components/echarts/EchartsEnvironment.vue";
import EchartsPeopleCarFlow from "@/components/echarts/EchartsPeopleCarFlow.vue";
export default {
  name: 'ManagementLeft',
  components: {
    // 环境监测告警趋势
    EchartsEnvironment,
    // 人流车流监测告警
    EchartsPeopleCarFlow
  },
  data () {
    return {
      // Tab默认打开项(近30天)
      activeName: "first",
      // 近30天栏的数据
      nearThree: [
        {
          id: 1,
          url: require("@/static/image/4/水浸.png"),
          color1: "#228cc5",
          color2: "#76fdff",
          p: "02",
          unit: "次",
          span: "水浸告警"
        },
        {
          id: 2,
          url: require("@/static/image/4/烟雾.png"),
          color1: "#c63645",
          color2: "#ff0b0b",
          unit: "次",
          p: "01",
          span: "烟火探测告警"
        },
        {
          id: 3,
          url: require("@/static/image/4/空气.png"),
          color1: "#6fb478",
          color2: "#a0ff76",
          unit: "次",
          p: "02",
          span: "空气成分告警"
        },
        {
          id: 4,
          url: require("@/static/image/4/人流.png"),
          color1: "#ffa200",
          color2: "#fff000",
          unit: "次",
          span: "人流密度超限",
          p: "12"
        },
        {
          id: 5,
          url: require("@/static/image/4/车流.png"),
          color1: "#67e3d1",
          color2: "#76ffe0",
          unit: "次",
          span: "车流量超限",
          p: "13"
        }
      ],
      // 近六个月栏的数据
      nearSix: [
        {
          id: 1,
          url: require("@/static/image/4/水浸.png"),
          color1: "#228cc5",
          color2: "#76fdff",
          p: "12",
          unit: "次",
          span: "水浸告警"
        },
        {
          id: 2,
          url: require("@/static/image/4/烟雾.png"),
          color1: "#c63645",
          color2: "#ff0b0b",
          unit: "次",
          p: "21",
          span: "烟火探测告警"
        },
        {
          id: 3,
          url: require("@/static/image/4/空气.png"),
          color1: "#6fb478",
          color2: "#a0ff76",
          unit: "次",
          p: "112",
          span: "空气成分告警"
        },
        {
          id: 4,
          url: require("@/static/image/4/人流.png"),
          color1: "#ffa200",
          color2: "#fff000",
          unit: "次",
          span: "人流密度超限",
          p: "51"
        },
        {
          id: 5,
          url: require("@/static/image/4/车流.png"),
          color1: "#67e3d1",
          color2: "#76ffe0",
          unit: "次",
          span: "车流量超限",
          p: "89"
        }
      ],
    }
  }
}
</script>
<style lang="scss" >
$precent: 100vw / 1920;
.management-left {
  margin-left: 0 * $precent;
  width: 463 * $precent;
  position: fixed;
  top: 80 * $precent;
  z-index: 10;
  h4 {
    text-align: left;
    font-size: 16 * $precent;
    font-family: "Arita";
    font-weight: 100;
    letter-spacing: 2 * $precent;
    height: 50 * $precent;
    line-height: 50 * $precent;
    display: flex;
    align-items: center;
    margin-left: 25 * $precent;
    > img {
      height: 40%;
      margin-left: 290 * $precent;
    }
    > span:nth-child(1) {
      width: 5 * $precent;
      height: 16 * $precent;
      background: #fff000;
    }
    span:nth-child(2) {
      margin-left: 10 * $precent;
    }
  }
  .management-left-top {
    position: relative;
    width: 100%;
    height: 340 * $precent;
    background: url("../../static/image/4/内容底图-1.png") no-repeat;
    background-size: 100% 100%;
    box-sizing: border-box;
    .image {
      width: 62 * $precent;
      height: 62 * $precent;
    }
    h4 {
      position: absolute;
      text-align: left;
    }
    .el-tabs {
      padding-top: 15 * $precent;
      padding-right: 25 * $precent;
      .el-tabs__header {
        border: none;
      }

      .el-tab-pane {
        margin-left: 50 * $precent;
        margin-top: 10 * $precent;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        .dayContent {
          width: 50%;
          margin-bottom: 20 * $precent;
          display: flex;
          flex-direction: row;
          justify-content: left;
          align-items: center;
          h1 {
            display: inline-block;
            margin-right: 5 * $precent;
          }
          > div {
            text-align: center;
            > h5 {
              margin-bottom: 2 * $precent;
            }
          }
        }
        .dayContent:nth-child(1) > div {
          color: #22b0db;
        }
      }
      .el-tabs__nav-scroll {
        display: flex;
        justify-content: flex-end;
      }
      .el-tabs__item {
        margin-top: 2 * $precent;
        width: 71 * $precent;
        height: 30 * $precent;
        line-height: 30 * $precent;
        padding: 0;
        color: #60d4c4;
      }
      .is-active {
        color: #a0ff76;
        background-color: #24618e;
        border: 1 * $precent solid #11a99a !important;
        border-radius: 5 * $precent;
      }
      #tab-second {
        border: none;
        padding: 0;
      }
      #tab-first {
        border: none;
      }
      .el-tabs__nav {
        border: none;
        // background: url("../static/image/4/tap.png") no-repeat;
        background-size: 100% 100%;
      }
    }
  }
  .management-left-center {
    width: 100%;
    height: 330 * $precent;
    background: url("../../static/image/4/内容底图-2.png") no-repeat;
    background-size: 100% 100%;
    h4 {
      text-align: left;
    }
    .environment {
      width: 100%;
      height: 260 * $precent;
    }
  }
  .management-left-bottom {
    width: 100%;
    height: 330 * $precent;
    background: url("../../static/image/4/内容底图-3.png") no-repeat;
    background-size: 100% 100%;
    h4 {
      text-align: left;
    }
    .peopleCarFlow {
      width: 100%;
      height: 260 * $precent;
    }
  }
}
</style>